package oop1.Task1;

import java.util.Scanner;

public class VisitorTest {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        while (true) {
            Visitor person = new Visitor();
            person.price = 20;
            System.out.print("请输入姓名:");
            person.name = input.next();
            if (person.name.equals("n"))
                break;
            System.out.print("请输入年龄:");
            person.age = input.nextInt();
            //调用方法
            person.personMoney();
        }
        System.out.println("退出程序");
    }
}
